﻿using System;
using System.ComponentModel.DataAnnotations;

namespace StevensReceipts.Domain
{
    public class Client : IEntity
    {
        [Key]
        public int Id { get; set; }

        [StringLength(50)]
        public string Username { get; set; }

        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [StringLength(18, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [RegularExpression("^((?=.*[a-z])(?=.*[A-Z])(?=.*\\d)).+$")]
        public string Password { get; set; }


        public DateTime? Created { get; set; }

        public DateTime? Modified { get; set; }

        public Client()
        {
            Created = DateTime.Now;
        }
    }
}